//
//  EJRefreshBackNormalFooter.m
//  IOSParents
//
//  Created by Lius on 2017/4/1.
//  Copyright © 2017年 ejiang. All rights reserved.
//

#import "EJRefreshBackNormalFooter.h"

@implementation EJRefreshBackNormalFooter

+ (instancetype)ej_footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action {
    EJRefreshBackNormalFooter *footer = [EJRefreshBackNormalFooter footerWithRefreshingTarget:target refreshingAction:action];
    
    UIColor * color = nil;
    if (@available(iOS 13.0, *)) {
        color = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {
            if (traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
                return [UIColor colorWithRed:(102.0 / 255) green:(102.0 / 255) blue:(102.0 / 255) alpha:1];
            } else {
                return [UIColor colorWithRed:(155.0 / 255) green:(155.0 / 255) blue:(155.0 / 255) alpha:1];
            }
        }];
    } else {
        // Fallback on earlier versions
        color = [UIColor colorWithRed:(155.0 / 255) green:(155.0 / 255) blue:(155.0 / 255) alpha:1];
    }
    
    footer.stateLabel.textColor = color;
    UIFont *font = [UIFont fontWithName:@"PingFangSC-Regular" size:13];
    if (font == nil) {
        if (@available(iOS 8.2, *)) {
            font = [UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
        } else {
            font = [UIFont systemFontOfSize:13];
        }
    }
    footer.stateLabel.font = font;
    
    return footer;
}

@end
